<template>
  <div>
    <div>账号切换</div>
    <button @click="admin()" type="default" size="mini">admin</button>
    <button @click="zhangsan()" type="default" size="mini">张三经理</button>
    <button @click="lisi()" type="default" size="mini">李四总经理</button>
    <div>当前token：{{ token }}</div>
  </div>
</template>

<script>
export default {
  name: "Test",

  data() {
    return {
      token: ''
    };
  },

  created(){
    this.token = window.localStorage.getItem('token')
  },

  methods: {
    admin() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNLMwMTU1MjI21FEqLU4t8kwBikGYeYm5qUAtiSm5mXlKtQCIkiYbQgAAAA.EwgO9JUjnoH9LPFoQglVq6Tp7TkZRmPk3r4l_UTMlJecPpcy87olJChC0-uZAM_Mdh9EBgAFMcuB-ypmVCdZIw'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },

    zhangsan() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNLMwMTU1MjYy0FEqLU4t8kxRsjKGMPMSc1OBWqoyEvPSixPzlGoBzLa22kUAAAA.Ub_GSe0Y6CvgH85JPb94LltEiRsZnVPLzlMJ95rvMIfM2iuJztTCMQTJWuxKl9pci3mbRTtvFF7HKAz5Cvq2vw'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },

    lisi() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNLMwMTWxNDUy0VEqLU4t8kxRsoIy8xJzU4FacjKLM5VqATs_A0lBAAAA.Sm1xlRmqspfCNuWN7qPLo9iUfZHAWOCgX-2JDIx53c7tgLpoaCCy5Rw_smoJ8264gYOFIQP0C8ayLzkqV_URhg'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    }
  }
}
</script>
